// 参考@张峻齐
//数组分割

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        int[] ans = new int[T];
        for (int i = 0; i < T; ++i) {
            int N = scanner.nextInt();
            int evenCount = 0, oddCount = 0;
            for (int j = 0; j < N; ++j) {
                int e = scanner.nextInt();
                if (e % 2 == 0) {++evenCount;}
                else {++oddCount;}
                if (oddCount % 2 == 0) {
                    ans[i] = (int) (Math.pow(2, evenCount) * Math.pow(2, oddCount == 0 ? 0 : oddCount - 1) % 1000000007);
                }else{ ans[i] = 0;}
            }
        }
        scanner.close();
        for (int e : ans){ System.out.println(e);}
    }
}